﻿Imports System
Imports System.Data
Imports System.Data.OracleClient
Imports System.Xml
Imports System.IO
#Region "#_moFiles"
Public Class getMoFiles
    Inherits List(Of stFileInfo)
#Region "#_Structures"
    Structure stFileInfo
        Dim filename As String
        Dim filesize As String
    End Structure
#End Region
#Region "#_Properties"
    Private _directory As String
    Private _filename As String
    Private _filesize As String
    Public ReadOnly Property Directory As String
        Get
            Return _directory
        End Get
    End Property
    Public ReadOnly Property Filename As String
        Get
            Return _filename
        End Get
    End Property
    Public ReadOnly Property Filesise As String
        Get
            Return _filesize
        End Get
    End Property
#End Region

    Public Enum DirectoryEntryTypes
        File
        Directory
    End Enum
    Public Sub New(ByVal Directory As String)
        _directory = Directory

        Call GetFilesInfo()
    End Sub
    Public Sub GetFilesInfo(Optional Extension As String = "*.xls")
        Dim dir As DirectoryInfo = New DirectoryInfo(_directory)
        Dim arOfFile As FileInfo() = dir.GetFiles(Extension)
        Dim fileinfo As New stFileInfo
        Dim i As Integer = 0

        For Each fi As FileInfo In arOfFile
            fileinfo.filename = fi.Name
            fileinfo.filesize = (fi.Length / 1024).ToString

            Me.Insert(i, fileinfo)

            i += 1
        Next
    End Sub


End Class
#End Region

